// 招聘相关接口
import request from "./request";
// 获取找工作列表
const getPosition = (data) => {
	return request({
		url: '/publish/queryWorkPosition',
		method: 'post',
		data
	})
}
// 发布编辑职位
const saveOrUpdatePosition = (data) => {
	return request({
		url: '/publish/saveOrUpdatePosition',
		method: 'post',
		data
	})
}
// 查询我发布的职位
const queryPublishPosition = (data) => {
	return request({
		url: '/publish/queryPublishPosition',
		method: 'post',
		data
	})
}

// 获取全部人才
const getAllResume = (data) => {
	return request({
		url: '/resume/pageAllResume',
		method: 'post',
		data
	})
}

// 模糊搜索
const queryResumeRecentSearches = (params) => {
	return request({
		url: '/resume/queryResumeRecentSearches',
		method: 'get',
		params
	})
}

// 模糊搜索列表
const searchPosition = (data) => {
	return request({
		url: '/publish/searchPosition',
		method: 'post',
		data
	})
}
// 全部职位列表
const queryAllPosition = (data) => {
	return request({
		url: '/publish/queryAllPosition',
		method: 'post',
		data
	})
}
// 获取简历详情
const queryAppWorkOrder = (data) => {
	return request({
		url: '/work/order/queryAppWorkOrder',
		method: 'post',
		data
	})
}
// 查询我的简历
const viewResume = (data) => {
	return request({
		url: '/resume/viewResume',
		method: 'post',
		data
	})
}
// 删除搜索记录
const delPositionSearch = (data) => {
	return request({
		url: '/resume/delPositionSearch',
		method: 'post',
		data
	})
}

// 创建个人信息
const saveUserResume = (data) => {
	return request({
		url: '/resume/saveUserResume',
		method: 'post',
		data
	})
}
// 获取职位
const viewPosition = (id) => {
	return request({
		url: `/publish/viewPosition/${id}`,
		method: 'get',
	})
}
// 获取兼职详情
const queryWorkOrderDetails = (id) => {
	return request({
		url: `/work/order/queryWorkOrderDetails/${id}`,
		method: 'get',
	})
}
// 支付
const payWorkOrder = (data) => {
	return request({
		url: `/work/order/payWorkOrder`,
		method: 'post',
		data
	})
}
// 修改订单状态
const updateWorkOrderState = (data) => {
	return request({
		url: `/work/order/updateWorkOrderState`,
		method: 'post',
		data
	})
}

// 评价
const updateWorkOrderScoring = (data) => {
	return request({
		url: `/work/order/updateWorkOrderScoring`,
		method: 'post',
		data
	})
}
// 简历详情
const getviewResume = (data) => {
	return request({
		url: `/resume/viewResume`,
		method: 'post',
		data
	})
}
// 查询职位详情
const viewPublishPosition = (id) => {
	return request({
		url: `/publish/viewPublishPosition/${id}`,
		method: 'get',
	})
}
// 简历显示隐藏
const setUserResume = (data) => {
	return request({
		url: `/resume/setUserResume`,
		method: 'post',
		data
	})
}
// 创建兼职订单
const saveAppWorkOrder = (data) => {
	return request({
		url: `/work/order/saveAppWorkOrder`,
		method: 'post',
		data
	})
}
// 暂停职位
const setPublishPosition = (data) => {
	return request({
		url: `/publish/setPublishPosition`,
		method: 'post',
		data
	})
}
const queryUserInfo = () => {
	return request({
		url: `/user/info/queryUserInfo`,
		method: 'get',
	})
}
// 新增工作经历
const addExperience = (data) => {
	return request({
		url: `/resume/addExperience`,
		method: 'post',
		data
	})
}
// 编辑工作经历
const upExperience = (data) => {
	return request({
		url: `/resume/upExperience`,
		method: 'post',
		data
	})
}
// 删除工作经历
const dleExperience = (data) => {
	return request({
		url: `/resume/dleExperience`,
		method: 'post',
		data
	})
}
export default{
	getPosition,
	saveOrUpdatePosition,
	queryPublishPosition,
	getAllResume,
	queryResumeRecentSearches,
	searchPosition,
	queryAllPosition,
	queryAppWorkOrder,
	viewResume,
	delPositionSearch,
	saveUserResume,
	viewPosition,
	queryWorkOrderDetails,
	payWorkOrder,
	updateWorkOrderState,
	updateWorkOrderScoring,
	getviewResume,
	setUserResume,
	viewPublishPosition,
	saveAppWorkOrder,
	setPublishPosition,
	queryUserInfo,
	addExperience,
	upExperience,
	dleExperience
}